<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      


<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="template.xhtml">
<link href="../css/styles.css" rel="stylesheet" type="text/css" />

	<ui:define name="title">
		<f:view>
			<title>Accueil</title>
		</f:view>
	</ui:define>

	<ui:define name="body">

		<table>
			<tr>
				<td><rich:panel id="info" style="width:350px; height:400px; ">
						<f:facet name="header">
							<h:outputText value="Recherche Voyage:" />
						</f:facet>

						<h:form id="ajaxValidatorForm">
							<h:panelGrid columns="2">

								<h:outputText value="Date de Depart : " />
								<rich:calendar cellWidth="24px" cellHeight="22px"   
									style="width:200px" datePattern="dd/MM/yyyy" value="#{manager.voyageTmp_recherche.date_depart}" />

								<!-- value="#{manager.voyageTmp_recherche.date_depart}" -->

								<h:outputText value="Date de Retour : " />
								<rich:calendar cellWidth="24px" cellHeight="22px"  
									style="width:200px" datePattern="dd/MM/yyyy" value="#{manager.voyageTmp_recherche.date_retour}" />

								<!-- value="#{manager.voyageTmp_recherche.date_retour}" -->

								<h:outputText value="Ville de Depart : " />
								<rich:comboBox defaultLabel="Choisir ville" value="#{manager.voyageTmp_recherche.ville_depart}">
										<f:selectItems value="#{service.ville_depart}" />
								</rich:comboBox>

								<h:outputText value="Destination : " />
								<rich:comboBox defaultLabel="Choisir ville"  value="#{manager.voyageTmp_recherche.destination}" >
									<f:selectItems value="#{service.ville_arrivee}" />
								</rich:comboBox>

								

								<h:outputText value="Nombre de personnes : " />
								<rich:comboBox selectFirstOnUpdate="false" defaultLabel="Nb personnes"  value="#{manager.voyageTmp_recherche.nb_personnes}"  >
									<f:selectItem itemValue="1" />
									<f:selectItem itemValue="2" />
									<f:selectItem itemValue="3" />
									<f:selectItem itemValue="4" />
									<f:selectItem itemValue="5" />
									<f:selectItem itemValue="6" />
								</rich:comboBox>
								
								

								<h:outputText value="Sport : " />
								<rich:comboBox defaultLabel="Choisir Sport" value="#{manager.voyageTmp_recherche.sport.nom}" >
									<f:selectItems value="#{service.sports}" />
								</rich:comboBox> 
							
							<!--  value="#{manager.voyageTmp_recherche.sport}" -->


							</h:panelGrid>

							<rich:simpleTogglePanel switchType="client"
								label="Plus de critères" width="300px" opened="false">

								<h:panelGrid columns="3">
									<h:outputText value="Budget max : " />
									<rich:comboBox  defaultLabel="Choisir Budget max" value="#{manager.voyageTmp_recherche.prix}">
										<f:selectItem itemValue="200" />
										<f:selectItem itemValue="400" />
										<f:selectItem itemValue="600" />
										<f:selectItem itemValue="800" />
										<f:selectItem itemValue="1000" />
										<f:selectItem itemValue="1200" />
										<f:selectItem itemValue="1400" />
									</rich:comboBox>
									<h:outputText value="€" />
							
									<h:outputText value="Transport : " />
									<rich:comboBox defaultLabel="Choisir Transport" value="#{manager.voyageTmp_recherche.transport}">
										<f:selectItems value="#{service.transports}" />
									</rich:comboBox>
									
								</h:panelGrid>
							</rich:simpleTogglePanel>
								<br></br>
								<h:commandButton action="#{manager.rechercheVoyage}" value="Rechercher" 
									style="width: 100px; ">	
								</h:commandButton>
						</h:form>
					</rich:panel>
				</td>

				<td><rich:panel columns="1" style="width:350px; height:400px;">
						
					

						<f:facet name="header">
							<h:outputText value="Liste des sports:" />
						</f:facet>
						
					<h:form id="ajaxValidatorForm2">	
						<h:panelGrid columns="1">	
						
<!-- 						 <h:selectOneRadio  layout="pageDirection"
						 value="#{manager.voyageTmp_rechercheListe.sport.nom}" >
                    	   <f:selectItems value="#{service.sports}" />

                  		  </h:selectOneRadio> -->
                  		  
                  		  <h:selectOneRadio  layout="pageDirection"
						 value="#{manager.voyageTmp_rechercheListe.sport.nom}" >
						 	<f:selectItem itemLabel="Football" itemValue="Football" />
						 	<f:selectItem itemLabel="Handball" itemValue="Handball" />
						 	<f:selectItem itemLabel="Rugby" itemValue="Rugby" />
						 	<f:selectItem itemLabel="Natation" itemValue="Natation" />
                    	   <f:selectItem itemLabel="autre choix" itemValue="autre_choix" />
                  		  </h:selectOneRadio>
                  		  
                  		  
                    
                   		 <h:commandButton action="#{manager.rechercheVoyageListe}" value="Rechercher" 
							style="width: 100px">	
						</h:commandButton>
						</h:panelGrid>
					</h:form>
				</rich:panel>
				</td>

			</tr>
			<tr>
				<td><rich:panel style="width:350px; height:400px;overflow:scroll">
						<f:facet name="header">
							<h:outputText value="Promotions:" />
						</f:facet>
								 <rich:dataTable 
					                    onRowMouseOver="this.style.backgroundColor='#F6CECE'"
					                    onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
					                    cellpadding="0" cellspacing="0" 
					                     border="0" value="#{service.promotions}" var="promotion"  >
					                    
					                    <f:facet name="header">
					                        <rich:columnGroup>
					                            <rich:column >
					                                <h:outputText value="Du" />
					                            </rich:column>
					                            <rich:column>
					                                <h:outputText value="Au" />
					                            </rich:column>
					                            <rich:column>
					                                <h:outputText value="Dest." />
					                            </rich:column>
					                            <rich:column>
					                                <h:outputText value="Sport" />
					                            </rich:column>
					                            <rich:column>
					                                <h:outputText value="Nb pers." />
					                            </rich:column>
					                            <rich:column>
					                                <h:outputText value="prix €" />
					                            </rich:column>
					                        </rich:columnGroup>
					
					                    </f:facet>
					
					                        <rich:column>
					                            <h:outputText value="#{promotion.date_depart}" >
					                            	<f:convertDateTime type="date" pattern="dd/MM/yyyy"/>                     	
					                            </h:outputText>
					                        </rich:column>
					                        <rich:column>
					                            <h:outputText value="#{promotion.date_retour}">
					                            	<f:convertDateTime type="date" pattern="dd/MM/yyyy"/>                     	
					                            </h:outputText>
					                        </rich:column>
					                        <rich:column>
					                            <h:outputText value="#{promotion.destination}"></h:outputText>
					                        </rich:column>
					                         <rich:column>
					                            <h:outputText value="#{promotion.sport.nom}"></h:outputText>
					                        </rich:column>
					                         <rich:column>
					                            <h:outputText value="#{promotion.nb_personnes}"></h:outputText>
					                        </rich:column>
					                         <rich:column>
					                            <h:outputText value="#{promotion.prix}">
					                            	<f:convertNumber  pattern="######.## €"  />
					                            </h:outputText>
					                        </rich:column>
					        </rich:dataTable>
					        
					         <br></br>
					        <form action="promotions.xhtml">
					         <input type="submit" value="Accéder aux promotions"/>
					          </form>
					       
					</rich:panel>
				</td>

				<td><rich:panel style="width:350px; height:400px;">
						<f:facet name="header">
							<h:outputText value="Fils info : " />
						</f:facet>

 						<div style="width:340px; height:370px;overflow:scroll">
						 <script language="JavaScript"
							src="http://convert.rss-to-javascript.com/?src=http://www.lequipe.fr/Xml/actu_rss.xml+">
							
						</script>  
						</div>
					</rich:panel>
				</td>


			</tr>
		</table>
	</ui:define>

</ui:composition>

</html>


